This file contains 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); |