Cast bytes to a String
without copying. This is the fastest way to get a String
from a Uint8Array
or ArrayBuffer
.
Only use this for ASCII strings. If there are non-ascii characters, your application may crash and/or very confusing bugs will happen such as "foo" !== "foo"
.
The input buffer must not be garbage collected. That means you will need to hold on to it for the duration of the string's lifetime.