We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a8ffc0c commit 0a50a45Copy full SHA for 0a50a45
packages/snowflake/examples/stripe-like.mjs
@@ -1,3 +1,13 @@
1
+/**
2
+ * Stripe provides excellent documentation, and their use of human-readable IDs
3
+ * makes it easier to identify resources at a glance.
4
+ *
5
+ * We can achieve similar readability by encoding our snowflake int64 IDs into Base62.
6
7
+ * For further reading, here's a great article by a Stripe developer:
8
+ * https://dev.to/stripe/designing-apis-for-humans-object-ids-3o5a/comments
9
+ */
10
+
11
import { Snowflake } from '@andrew_l/snowflake';
12
import { base62, bigIntFromBytes } from '@andrew_l/toolkit';
13
0 commit comments