Chris Tate
f716dec756
Convert Buffers to and from latin1 and hex text a word at a time
...
- toString("latin1"): counts the high bytes eight at a time, copies
words of ASCII bytes, and writes other bytes from a table of their
UTF-8 pairs without branches. ASCII-only results are marked ASCII, and
other results record their UTF-16 length (one unit per byte), so
`.length` does not walk the string.
- Buffer.from(text, "latin1" | "ascii" | "binary"): copies text known to
be ASCII, copies words of ASCII bytes, and decodes eight bytes of one-
and two-byte sequences in one word, storing each output byte without
branches. Longer sequences take the previous path.
- Buffer.from(text, "hex"): reads digit values from a table.
- toString("hex") and toString("base64"/"base64url") mark their results
ASCII, so a later decode, length or index read skips the scan for
non-ASCII bytes.
2026-10-24 23:26:01 -05:00
..
2026-10-18 15:11:32 -07:00
2026-10-24 23:26:01 -05:00
2026-10-22 13:11:34 -05:00
2026-10-20 00:21:45 -05:00
2026-10-20 00:21:45 -05:00
2026-10-22 03:44:38 -05:00
2026-10-22 03:00:21 -05:00
2026-10-14 21:17:46 -05:00
2026-10-15 06:12:23 -07:00
2026-10-22 04:44:34 -05:00
2026-10-22 02:09:43 -05:00
2026-10-20 17:56:44 -05:00
2026-10-22 09:55:01 -05:00
2026-10-21 20:07:00 -05:00
2026-10-21 21:55:47 -05:00
2026-10-23 22:31:08 -05:00
2026-10-23 20:13:09 -05:00
2026-10-23 21:34:14 -05:00
2026-10-17 19:11:33 -05:00
2026-10-22 20:33:09 -05:00
2026-10-22 06:11:52 -05:00
2026-10-24 16:26:38 -05:00
2026-10-16 06:54:44 -07:00
2026-10-22 20:36:52 -05:00
2026-10-23 20:45:37 -05:00
2026-10-18 15:11:32 -07:00
2026-10-22 22:56:12 -05:00
2026-10-22 03:44:38 -05:00
2026-10-18 15:11:32 -07:00
2026-10-15 07:59:19 -05:00
2026-10-18 15:19:39 -07:00
2026-10-16 06:59:43 -07:00
2026-10-22 03:44:38 -05:00
2026-10-17 12:08:06 -07:00
2026-10-21 21:28:46 -05:00
2026-10-23 10:42:51 -05:00
2026-10-15 05:07:10 -07:00
2026-10-16 01:10:45 -05:00
2026-10-23 20:02:25 -05:00
2026-10-23 22:08:02 -05:00
2026-10-23 17:41:28 -07:00
2026-10-24 22:34:45 -05:00
2026-10-24 21:59:28 -05:00
2026-10-20 16:42:01 -07:00
2026-10-17 11:10:43 -07:00
2026-10-23 13:20:59 -05:00
2026-10-16 04:45:45 -05:00
2026-10-18 15:11:32 -07:00
2026-10-17 12:28:03 -07:00
2026-10-18 15:11:32 -07:00
2026-10-20 17:56:44 -05:00
2026-10-19 07:55:06 -05:00
2026-10-23 10:16:30 -05:00
2026-10-18 07:31:43 -07:00
2026-10-18 07:31:43 -07:00
2026-10-20 17:56:44 -05:00
2026-10-20 17:56:44 -05:00
2026-10-24 21:09:40 -05:00
2026-10-23 18:11:49 -05:00
2026-10-24 15:56:52 -05:00
2026-10-24 00:34:25 -05:00
2026-10-24 16:05:36 -05:00
2026-10-23 06:22:00 -05:00
2026-10-14 21:09:51 -05:00
2026-10-23 00:05:57 -05:00
2026-10-22 19:32:49 -07:00
2026-10-22 11:46:21 -05:00
2026-10-14 09:58:18 -05:00
2026-10-23 22:59:39 -05:00
2026-10-16 20:13:00 -05:00
2026-10-16 05:12:23 -05:00
2026-10-22 08:03:32 -05:00
2026-10-22 08:16:36 -05:00
2026-10-17 16:00:54 -05:00
2026-10-24 13:20:02 -05:00
2026-10-15 13:39:03 -05:00
2026-10-23 10:32:15 -05:00
2026-10-20 17:56:44 -05:00
2026-10-24 13:47:17 -05:00
2026-10-22 09:39:07 -05:00
2026-10-18 15:11:32 -07:00
2026-10-21 13:12:24 -05:00
2026-10-23 22:40:04 -05:00
2026-10-13 21:24:38 -05:00
2026-10-23 22:40:04 -05:00
2026-10-16 14:02:02 -07:00
2026-10-23 18:26:12 -05:00
2026-10-17 13:32:48 -07:00
2026-10-22 03:44:38 -05:00
2026-10-24 21:50:36 -05:00
2026-10-23 19:28:30 -05:00
2026-10-20 11:00:03 -05:00
2026-10-19 23:38:15 -05:00
2026-10-22 09:32:19 -05:00
2026-10-24 00:43:56 -05:00
2026-10-18 15:19:39 -07:00
2026-10-18 15:19:39 -07:00
2026-10-24 18:32:42 -05:00
2026-10-24 12:37:29 -05:00
2026-10-14 21:28:04 -05:00