We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f6186c commit e777728Copy full SHA for e777728
lib/util/createBoundary.browser.ts
@@ -0,0 +1,14 @@
1
+/**
2
+ * Generates a boundary string of given length.
3
+ */
4
+function createBoundary(length: number): string {
5
+ const octets = new Uint8Array(length)
6
+
7
+ crypto.getRandomValues(octets)
8
9
+ return [...octets]
10
+ .map<string>(octet => octet.toString(16).padStart(2, "0"))
11
+ .join("")
12
+}
13
14
+export default createBoundary
0 commit comments