danakt / uuid-by-string Goto Github PK
View Code? Open in Web Editor NEWGenerates the RFC-4122 Name-Based UUID
License: MIT License
Generates the RFC-4122 Name-Based UUID
License: MIT License
First of all, thank you for the library!
Have you considered using crypto.createHash to create md5/sha1 hashes instead of the js dependencies?
This would allow us to use your libraries in non-node runtimes like cloudflare workers (currently it fails because js-md5
contains eval
which is usually a no-no for security reasons).
I created a temporary fork and replaced the dependencies for the native crypto
and all tests passed succesfully, can create a PR if you agree.
Thanks!
I'd like to point out that according to the spec,
The hexadecimal values “a” through “f” are output as lower case characters and are case insensitive on input.
So this tool is technically not quite compliant, although I don't know how much practical consequence that is since tools that read the id are required to ignore the case.
It's probably a one-line change here, but of course the documentation and tests would also need to change to match.
Hi,
please provide your package es5 compatible. For example the index.js files uses object destructuring, an es6 feature:
const { md5Hash, stringToCharBuffer, sha1Hash, hashToUuid, concatBuffers } = require('./lib')
Best regards, Florian
Hello
I am trying to generate the UUID from a string. I have done the same in Android and Python. On both the platforms the same UUID is generated, but in this library the generated one different (Only the partial part is different).
The outputs:
Android:
12f01aa4-5090-3f83-b823-7e7cb43246e7
Python3:
12f01aa4-5090-3f83-b823-7e7cb43246e7
Nodejs (This library):
12f01aa4-5090-1f83-b823-7e7cb43246e7
As you can see, the third segment (3f83 != 1f83) is different in generated value. Please let me know if this is an issue in the library.
Code used:
getUuid("9239107d-259f-4cf8-b62d-0964b680ab08", 3)
Hi,
I found an issue with the following versions:
React: "16.8.3"
React-Native: "0.59.2"
uuid-by-string: "^2.1.0"
Issue:
in /src/lib.js
, line 74, ...new Buffer...
returns the error. adding import { Buffer, } from 'buffer';
to the top of the file and as a dependency in the package.json
file, will solve this issue.
Please let me know if this can be fixed in the next version or if I need to handle it on my own?
Thanks,
-Mazen
I cannot find a changelog, version 4 has not even a tag or a release, the PR for version 4 has no info.
Where can we find info about what changed in version 4 so we can update?
Please add some documentation about this.
Code snippet:
import generateUuid from "uuid-by-string";
convertStringToUUID (stringToConvert: string) {
const uuidHash = generateUuid(stringToConvert);
return uuidHash;
}
hi danakt
Couldn't find a better way to contact you as ask here via 'Issue'
Is there a way to decode guid back to original string? or is it only one way process?
const getUuid = require('uuid-by-string');
const uuidHash = getUuid("好");
console.log(uuidHash)
const uuidHash2 = getUuid("白");
console.log(uuidHash2)
result:
c2b7df62-01fd-5336-a399-091f0a29550d
c2b7df62-01fd-5336-a399-091f0a29550d
Hi @danakt - I understand that this module always returns the same UUID for a particular input string.
I had a quick question - is it possible to reverse the generated UUID to get back the original string?
Much thanks,
Mahendra
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.