hashids

package
v0.0.0-...-c5bcced Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

The id/hashids package enables encoding and decoding hashids.

var lib = require('id/hashids');
var gen = lib(12, lib.ALPHABET, "my unique salt");
var enc = gen.encode(146, 5672, 57399);
var dec = gen.decode(enc);
console.log(enc, dec);

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(orb *orbit.Orbit) interface{}

Types

type Hasher

type Hasher struct {
	// contains filtered or unexported fields
}

func NewHasher

func NewHasher(orb *orbit.Orbit, hid *hashids.HashID) *Hasher

func (*Hasher) Decode

func (this *Hasher) Decode(hash string) []int

func (*Hasher) Encode

func (this *Hasher) Encode(nums ...int) string

type Module

type Module struct {
	ALPHABET string
	// contains filtered or unexported fields
}

func (*Module) New

func (this *Module) New(min int, char, salt string) *Hasher

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL