* Percent-encode bytes. * @param {Uint8Array} bytes Bytes * @return {string} URL encoded bytes
(bytes)
| 62 | * @return {string} URL encoded bytes |
| 63 | */ |
| 64 | encodeBytes (bytes) { |
| 65 | let string = '' |
| 66 | for (let i = 0; i < bytes.length; i++) { |
| 67 | string += '%' + ('0' + bytes[i].toString(16)).slice(-2) |
| 68 | } |
| 69 | return string |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Performs decode on given content. |