Created
April 25, 2022 08:14
-
-
Save aquarla/0473163eaaa039627ece78d041516fe7 to your computer and use it in GitHub Desktop.
なんちゃってSnowflake
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default function pseudoSnowflake() { | |
| const now = new Date(); | |
| const time = now.getTime(); | |
| return (BigInt(time) << BigInt(16) + BigInt(Math.floor(Math.random(2**16)))).toString(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment