This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * One of the questions that recently came up is how to remove vowels from Hebrew characters in Unicode | |
| * (or any other similar language). A quick look at Hebrew Unicode chart shows that the vowels are all | |
| * located between 0x0591 (1425) and 0x05C7 (1479). With this and Javascript's charCodeAt function, it | |
| * is trivial to strip them out with Javascript as follows | |
| * | |
| * Live demo is available here: | |
| * https://jsfiddle.net/js0ge7gn/ | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var dictionary = { | |
| 'a': 'ש', | |
| 'b': 'נ', | |
| 'c': 'ב', | |
| 'd': 'ג', | |
| 'e': 'ק', | |
| 'f': 'כ', | |
| 'g': 'ע', | |
| 'h': 'י', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Web-Push | |
| // Public base64 to Uint | |
| function urlBase64ToUint8Array(base64String) { | |
| var padding = '='.repeat((4 - base64String.length % 4) % 4); | |
| var base64 = (base64String + padding) | |
| .replace(/\-/g, '+') | |
| .replace(/_/g, '/'); | |
| var rawData = window.atob(base64); | |
| var outputArray = new Uint8Array(rawData.length); |