Array of Bytes and UTF-8 encoding

Posted on October 1, 2021
Tags: javascript

1 Array of bytes

flowchart BT
    X["Array of Bytes\n(AOB)"]
    UU["Uint8Array"] --->|implements| X
    subgraph UU["Uint8Array"]
    P["Uint8Array\ndefault decimal rep\n[244,5,194,52,143]"] 
    P --o R["hex rep\n[0xF4,0x5,0xC2,0x34,0x8F]"]
    P --o RR["binary rep"]
    P --o RRR["octal rep"]
    VV["UTF8-Encoding"] ---|"equivalent\nrepresents"| P
    end
    Q["Human String"]
    
    
    VV .->|"decode(AOB)"| Q
    Q .-> |"encode(Str)"|VV