Skip to content

Instantly share code, notes, and snippets.

View geekynasir's full-sized avatar
:octocat:
Working from home

Nasir Iqbal geekynasir

:octocat:
Working from home
View GitHub Profile
@gxvxc
gxvxc / blurhashDataURL.ts
Last active April 25, 2025 12:45 — forked from mattiaz9/blurhashDataURL.ts
Convert blurhash to a base64 DataURL string (no canvas or node-canvas)
import { decode } from "blurhash"
const cache: Record<string, string> = {}
export function blurHashToDataURL(hash: string | undefined): string | undefined {
if (!hash) return undefined
const cachedBlurDataURL = cache[hash]
if(cachedBlurDataURL) {