패키지, 저장소 및 앱 카테고리 검색

패키지 상세v2.0.0

hashids2

Hashids는 숫자에서 유튜브와 비슷한 ID를 생성하는 가벼운 라이브러리입니다. 데이터베이스 ID를 사용자에게 노출하고 싶지 않을 때 Hashids를 사용하세요.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
9.6천
좋아요
29
Pub 점수
140

패키지 설치

flutter pub add hashids2

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Hashids2는 숫자에서 짧고 고유하며 URL 안전한 ID를 생성하는 가벼운 Dart 패키지로, YouTube의 ID 형식과 유사합니다. 데이터베이스 ID를 은폐하여 사용자가 순차적 식별자를 추측하거나 조작하지 못하도록 설계되었습니다. 보안을 위해 은닉성을 활용하는 공개 애플리케이션에 적합합니다. Android, iOS, Web, macOS, Windows, Linux 등 다양한 플랫폼을 지원하여 크로스플랫폼 앱에 매우 유연하게 적용할 수 있습니다. 고유성과 출력 형식 제어를 위해 사용자 정의 가능한 솔트와 길이 설정을 사용합니다.

사용 사례

  • URL에서 데이터베이스 ID 가리기
  • 짧은 고유 식별자 생성
  • ID 열거로부터 API 엔드포인트 보호
  • 사용자 친화적인 공유 링크 만들기
  • 공개 API에서 순차적 ID 노출 방지

주요 기능

  • 숫자에서 URL 안전한 문자열 생성
  • 사용자 정의 가능한 소금 및 최소 길이
  • 크로스 플랫폼 호환성
  • Flutter 앱과의 간단한 통합
  • 인코딩과 디코딩을 모두 지원

적합한 대상

  • 안전한 ID 생성이 필요한 웹 및 모바일 앱
  • 데이터베이스 구조를 숨기고 싶은 개발자
  • 공개적으로 노출된 식별자와 함께 사용되는 애플리케이션
  • 복잡한 암호화 없이 간단한 오브스커레이션을 필요로 하는 프로젝트

고려 사항

  • 고보안 암호화 요구 사항에는 적합하지 않습니다
  • 유일성을 위해 주의 깊게 소금 관리가 필요합니다
  • 암호화 또는 인증을 제공하지 않음
  • 출력 길이는 입력 크기와 구성에 따라 달라집니다
  • ID 가리기만 가능하며, 전체 데이터 보호는 아님

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Hashids2

Build Status Coverage Status pub package

A Dart class to generate YouTube-like hashes from one or many numbers.

Ported from javascript hashids.js by Ivan Akimov

What is it?

Hashids (Hash ID's) creates short, unique, decryptable hashes from unsigned (long) integers.

This algorithm tries to satisfy the following requirements:

  1. Hashes must be unique and decryptable.
  2. They should be able to contain more than one integer (so you can use them in complex or clustered systems).
  3. You should be able to specify minimum hash length.
  4. Hashes should not contain basic English curse words (since they are meant to appear in public places - like the URL).

Instead of showing items as 1, 2, or 3, you could show them as U6dc, u87U, and HMou. You don't have to store these hashes in the database, but can encrypt + decrypt on the fly.

All (long) integers need to be greater than or equal to zero.

Usage

Import the package

Follow instructions from Pub.

Encrypting
final hashids = HashIds();
final fromNumber = hashids.encode(42);
final fromList = hashids.encode([1,2,3]);
final fromString = hashids.encode('42');
Decrypting
final hashids = HashIds();
final number = hashids.decode(fromNumber); // [42]
final list = hashids.decode(fromList); // [1,2,3]
final string = hashids.decode(fromString); // [42]

License

MIT License. See the LICENSE file. You can use Hashids in open source projects and commercial products. Don't break the Internet. Kthxbye.

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.