MCPcopy
hub / github.com/Exrick/xpay / encodeHex

Function encodeHex

xpay-code/src/main/resources/static/swagger/swagger-ui.js:10306–10325  ·  view source on GitHub ↗
(character)

Source from the content-addressed store, hash-verified

10304}
10305
10306function encodeHex(character) {
10307 var string, handle, length;
10308
10309 string = character.toString(16).toUpperCase();
10310
10311 if (character <= 0xFF) {
10312 handle = 'x';
10313 length = 2;
10314 } else if (character <= 0xFFFF) {
10315 handle = 'u';
10316 length = 4;
10317 } else if (character <= 0xFFFFFFFF) {
10318 handle = 'U';
10319 length = 8;
10320 } else {
10321 throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');
10322 }
10323
10324 return '\\' + handle + common.repeat('0', length - string.length) + string;
10325}
10326
10327function State(options) {
10328 this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;

Callers 1

escapeStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected