/\p{L}\p{M}?|\S|\s/guUsage:
"മാസങ്ങളിൽ മേടം പ്രധാനം".match(/\p{L}\p{M}?|\S|\s/gu); // ["മാ", "സ", "ങ്", "ങ", "ളി", "ൽ", " ", "മേ", "ടം", " ", "പ്", "ര", "ധാ", "നം"]| function* fibonacci(max = Number.MAX_SAFE_INTEGER) { | |
| let current = 1; | |
| let previous = 0; | |
| while (current <= max) { | |
| [current, previous] = [previous, current + previous]; | |
| if (current <= max) { | |
| yield current; | |
| } else { | |
| return; | |
| } |
/\p{L}\p{M}?|\S|\s/guUsage:
"മാസങ്ങളിൽ മേടം പ്രധാനം".match(/\p{L}\p{M}?|\S|\s/gu); // ["മാ", "സ", "ങ്", "ങ", "ളി", "ൽ", " ", "മേ", "ടം", " ", "പ്", "ര", "ധാ", "നം"]| using System; | |
| using System.Collections.Generic; | |
| using System.Numerics; | |
| public static class BigIntegerExtensions | |
| { | |
| private static readonly char[] digits = new char[] | |
| { | |
| '0', '1', '2', '3', '4', '5', '6', '7', | |
| '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', |
| Object.defineProperty(BigInt.prototype, "toBase62String", { | |
| value: function () { | |
| const base = 62n; | |
| const digits = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
| const sign = this < 0n ? "-" : ""; | |
| let [result, quotient] = ["", sign ? 0n - this : this]; | |
| do { | |
| result = `${digits[Number(quotient % base)]}${result}`; | |
| } while (quotient /= base); | |
| return `${sign}${result}`; |
| Object.defineProperty(BigInt.prototype, "toBase62String", { | |
| value: function () { | |
| const base = 62n; | |
| const digits = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
| const sign = this < 0n ? "-" : ""; | |
| let [result, quotient] = ["", sign ? 0n - this : this]; | |
| do { | |
| result = `${digits[Number(quotient % base)]}${result}`; | |
| } while (quotient /= base); | |
| return `${sign}${result}`; |
| Object.defineProperty(BigInt.prototype, "toBase64String", { | |
| value: function () { | |
| const base = 64n; | |
| const digits = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&#"; | |
| const sign = this < 0n ? "-" : ""; | |
| let [result, quotient] = ["", sign ? 0n - this : this]; | |
| do { | |
| result = `${digits[Number(quotient % base)]}${result}`; | |
| } while (quotient /= base); | |
| return `${sign}${result}`; |
| function bigIntToBase64(value) { | |
| const base = 64n; | |
| const digits = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&#"; | |
| const sign = value < 0n ? "-" : ""; | |
| let [result, quotient] = ["", sign ? 0n - this : this]; | |
| do { | |
| result = `${digits[Number(quotient % base)]}${result}`; | |
| } while (quotient /= base); | |
| return `${sign}${result}`; | |
| } |
| const getRandomIdString = (steps = 4) => { | |
| let seed = ""; | |
| for (let i = 0; i < steps; i++) { | |
| seed += Math.random().toString().substring(2); | |
| } | |
| return BigInt(seed).toString(36).toUpperCase(); | |
| }; |
| Object.defineProperty(Object.prototype, "toString", { | |
| value: function () { | |
| return JSON.stringify( | |
| this, | |
| (function () { | |
| const ancestors = []; | |
| return function (key, value) { | |
| if (typeof value !== "object" || value === null) { | |
| return value; | |
| } |
| { | |
| "@content.downloadUrl": "https://public.dm.files.1drv.com/[200+ characters long random string]", | |
| "createdBy": { | |
| "application": { | |
| "displayName": "OneDrive", | |
| "id": "[file_id]" | |
| }, | |
| "user": { | |
| "displayName": "[user_display_name]", | |
| "id": "[user_id]" |