export class Base64Utlis { public static base64ToBlob ( code ) { var parts = code . split ( ";base64," ) ; var contentType = parts [ 0 ] . split ( ":" ) [ 1 ] ; var raw = window . atob ( parts [ 1 ] ) ; var rawLength = raw . length ; var uInt8Array = new Uint8Array ( rawLength ) ; for ( var i = 0 ; i < rawLength ; ++ i ) { uInt8Array [ i ] = raw . charCodeAt ( i ) ; } return new Blob ( [ uInt8Array ] , { type : contentType } ) ; } }