crypt

package module
v2.0.0-...-49b3bd4 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CFB cryptCFB

Encryption: AES-CFB

View Source
var Hash cryptHash

Hashing: HMAC - SHA256

Functions

func GenUUID

func GenUUID(size int, timezone ...string) string

GenUUID generates a Unique Identifier using a custom build method

Notice: This feature is currently in beta

@size: (minimum: 8) the bit size for the last part of the uuid (note: other parts may vary)

@timezone: optionally add a timezone string to the uuid (note: you could also pass random info into here for a more complex algorithm)

This method uses the following data:

  • A hash of the current year and day of year
  • A hash of the current timezone
  • A hash of the current unix time (in seconds)
  • A hash of the current unix time in nanoseconds and a random number

The returned value is url encoded and will look something like this: xxxx-xxxx-xxxx-xxxxxxxx

func RandBytes

func RandBytes(size int, exclude ...[]byte) []byte

RandBytes generates random bytes using crypto/rand

@exclude[0] allows you can to pass an optional []byte to ensure that set of chars will not be included in the output string

@exclude[1] provides a replacement string to put in place of the unwanted chars

@exclude[2:] is currently ignored

Types

This section is empty.

Jump to

Keyboard shortcuts

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