TheoryOfNekomata 2d7128e43c | pirms 2 gadiem | |
---|---|---|
src | pirms 2 gadiem | |
test | pirms 2 gadiem | |
.eslintrc | pirms 2 gadiem | |
.gitignore | pirms 2 gadiem | |
LICENSE | pirms 2 gadiem | |
README.md | pirms 2 gadiem | |
package.json | pirms 2 gadiem | |
pridepack.json | pirms 2 gadiem | |
tsconfig.eslint.json | pirms 2 gadiem | |
tsconfig.json | pirms 2 gadiem | |
yarn.lock | pirms 2 gadiem |
UUID as a Buffer.
UUIDs are 128-bit values used for identification of entities. Representing them as strings are expensive since it can incur more than 128 bits. This library will help properly represent UUID values while still having some utility methods like serialization (i.e. converting them to string representations), as well as generation according to the v4 spec.
import { Uuid } from '@theoryofnekomata/uuid-buffer';
const newUuidV4 = Uuid.v4(); // sync
let uuidStr = '1d4a8818-a773-4b52-9b6b-4db8c7fd9bf2';
// this method can accept strings, buffers, and bute arrays
const uuidFromStr = Uuid.from(uuidStr);
See LICENSE file for details.