Byte literals are specified using a b declaration prefix followed by
bytes represented as a sequence of characters, two-place hexadecimal
values (for example, b'\x0F', not b'\xF'), or three-place octal
values (for example, b'\000', not b'\0'). Character sequences are
interpreted as UTF-8 encoded strings.
// These are all equal to decimal 42.b'*'b'\x2A'b'\052'// These are all equivalentb'€' // 3-byte UTF-8 encoded stringb'\342\202\254'b'\xE2\x82\xAC'
Functions for the Bytes type are provided to aid comparison of byte
sequences represented as Base64url- and hexadecimal-encoded strings.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2019-12-03 UTC."],[],[],null,["# Interface: Bytes\n\n[rules](/docs/reference/rules/rules).Bytes\n==========================================\n\ninterface static\n\nType representing a sequence of bytes.\n\nByte literals are specified using a `b` declaration prefix followed by\nbytes represented as a sequence of characters, two-place hexadecimal\nvalues (for example, `b'\\x0F'`, not `b'\\xF'`), or three-place octal\nvalues (for example, `b'\\000'`, not `b'\\0'`). Character sequences are\ninterpreted as UTF-8 encoded strings. \n\n```scilab\n// These are all equal to decimal 42.\nb'*'\nb'\\x2A'\nb'\\052'\n\n// These are all equivalent\nb'€' // 3-byte UTF-8 encoded string\nb'\\342\\202\\254'\nb'\\xE2\\x82\\xAC'\n```\n\nFunctions for the Bytes type are provided to aid comparison of byte\nsequences represented as Base64url- and hexadecimal-encoded strings.\n\nMethods\n-------\n\n### size\n\nsize() returns [rules.Integer](/docs/reference/rules/rules.Integer)\n\nReturns the number of bytes in a Bytes sequence.\n\nReturns\n\n: `non-null `[rules.Integer](/docs/reference/rules/rules.Integer) the number of bytes.\n\n#### Example\n\n b'\\xFF\\xFF'.size() == 2\n b'a'.size() == 1\n b'€'.size() == 3 // 3-byte UTF-8 encoded string\n\n### toBase64\n\ntoBase64() returns [rules.String](/docs/reference/rules/rules.String)\n\nReturns the Base64-encoded string corresponding to the provided Bytes\nsequence.\n\nBase64 encoding is performed per the\n[base64url specification](https://tools.ietf.org/html/rfc4648#page-7).\n\nReturns\n\n: `non-null `[rules.String](/docs/reference/rules/rules.String) a Base64-encoded string.\n\n#### Example\n\n b'\\xFB\\xEF\\xBE'.toBase64() == '----'\n\n### toHexString\n\ntoHexString() returns [rules.String](/docs/reference/rules/rules.String)\n\nReturns the hexadecimal-encoded string corresponding to the provided Bytes\nsequence.\n\nReturns\n\n: `non-null `[rules.String](/docs/reference/rules/rules.String) a hexadecimal-encoded string.\n\n#### Example\n\n b'\\x2A'.toHexString() == '2A'\n b'**'.toHexString() == '2A2A'\n b'€'.toHexString() == 'E282AC'"]]