swift_ids 1.1.4 copy "swift_ids: ^1.1.4" to clipboard
swift_ids: ^1.1.4 copied to clipboard

outdated

Convert numeric IDs to human friendly hash string that is shorter and easier to write and memorize.

example/swift_ids.dart

#!/usr/bin/env dart

import 'package:swift_ids/swift_ids.dart';

void main (List<String> arguments) {
  var encode = new Id(5);
  print("${encode.value} == ${encode.toString()}"); //5 == D9YU
  var decode = new Id.fromString('D9YU');
  print("${decode.value} == ${decode.toString()}"); //4 == C84X

  var encode2 = new Id(5, minLength:10, zero:0x55555555555);
  print("${encode2.value} == ${encode2.toString()}"); //5 == HBQ8H7E85B
  //same zero/minLength need to be used when decoding
  var decode2 = new Id.fromString('HBQ8H7E85B', minLength:10, zero:0x55555555555);
  print("${decode2.value} == ${decode2.toString()}"); //4 == C84X
}
1
likes
0
pub points
0%
popularity

Publisher

verified publisherswift.shop

Convert numeric IDs to human friendly hash string that is shorter and easier to write and memorize.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on swift_ids