Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary Compatibility #4

Open
Lewiscowles1986 opened this issue Dec 8, 2016 · 1 comment
Open

Binary Compatibility #4

Lewiscowles1986 opened this issue Dec 8, 2016 · 1 comment

Comments

@Lewiscowles1986
Copy link
Owner

ulid/javascript#11

Need to implement binary and API compatibility with original lib.

Unsure if pack can be used, needs tests and toByteArray method.

@Lewiscowles1986
Copy link
Owner Author

Actually, it looks like the binary format will change the output of this library

  • https://gist.github.com/bigcalm/4599839 works with 48-bit numbers, but it's the wrong byte-order (no idea if how they are sourcing numbers as well as pack structure is the reason for this).

  • pack("NnnNN", $time32H, $time16L, $random16ubit, $random32ubit1, $random32ubit2) should work, but this means new interfaces are needed to facilitate interfacing with something to split the time and random source (before encoding to string).

  • needs a correctly implemented adder to encode to base32 correctly (maybe there is something that can be used for this)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant