// base64 转 file
export const base64ToFile = (base64, name = Date.now()) => {
    const reg = /^data:(.+?\/(.+?));base64,/
    const originStr = atob(base64.replace(reg, ''))
    let U8Arr = new Uint8Array(originStr.length)
    for (let i = 0; i < originStr.length; i++) U8Arr[i] = originStr.charCodeAt(i)
    const [, type, suffix] = base64.match(reg)
    return new File([U8Arr], name + '.' + suffix, { type })
}
