MCPcopy Index your code
hub / github.com/feross/buffer / asciiToBytes

Function asciiToBytes

index.js:2034–2041  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

2032}
2033
2034function asciiToBytes (str) {
2035 const byteArray = []
2036 for (let i = 0; i < str.length; ++i) {
2037 // Node's code seems to be doing this and not & 0x7F..
2038 byteArray.push(str.charCodeAt(i) & 0xFF)
2039 }
2040 return byteArray
2041}
2042
2043function utf16leToBytes (str, units) {
2044 let c, hi, lo

Callers 1

asciiWriteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…