slugid 1.1.2 copy "slugid: ^1.1.2" to clipboard
slugid: ^1.1.2 copied to clipboard

A URL-safe base64 encoding for UUIDv4 stripped of padding. Useful when embedding short random UUIDs in URLs.

example/main.dart

// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import 'package:slugid/slugid.dart';

void main() {
  print('Generating 5 random slugids:');
  for (var i = 0; i < 5; i++) {
    // Using the _nice_ variant, which cannot start with dashes, this is always
    // nice if for some reason the ID might be given as commandline argument in
    // some tool some day.
    print(Slugid.nice());
  }
}
46
likes
160
pub points
83%
popularity

Publisher

verified publishergoogle.dev

A URL-safe base64 encoding for UUIDv4 stripped of padding. Useful when embedding short random UUIDs in URLs.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#uuid

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

convert, meta

More

Packages that depend on slugid