Documentation
¶
Overview ¶
ACID is an UUID like value created from a data hash (SHA3) salted with 48 random bits.
Aim was to create a rather unique salted value in a common format, from a data source (string, file, etc.) that was computed by a cryptographic hash function and thus not easily retraceable and equipped with a random component that has the effect that two of the same do not necessarily result in the same value. But the identical random component must make it's result deterministic. Great for eg. User-ID build from simple person attributes like given name and surname.
ACID is similar to UUIDv5 since both are hashed values as SHA3-512 and respectively SHA1 for UUIDv5. A UUIDv7 inspiration is the use of 48 random bits, that are included as a salt and are visibly represented in the last 6 bytes of the value.
Example ¶
package main
import (
"fmt"
"log"
"catinello.eu/acid"
)
func main() {
a, err := acid.New([]byte("User1"))
if err != nil {
log.Fatal(err)
}
fmt.Println(a)
}
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ACID ¶
type ACID [size]byte
ACID is a 128 bit (16 byte) Universal Unique IDentifier.