3 ms·
How did they convert the mp3/ogg into strings?
by krsunny 13y ago
How did they convert the mp3/ogg into strings?
- charonn0 13y agoBase64 encoded. See: https://en.wikipedia.org/wiki/Data_URI_scheme https://en.wikipedia.org/wiki/Data_URI_scheme
- verisimilitude 13y agoLove Base64 encoding... for anyone looking to optimize their CSS, check out Shaun Inman's CSS Cacheer... it can automatically inline images using that encoding: http://www.shauninman.com/archive/2008/05/30/check_out_css_cacheer http://www.shauninman.com/archive/2008/05/30/check_out_css_c... Sorry for slightly OT, but I really do love Base64...
- sc00ter 13y agoOr if you're on Rails, there's a little-known helper as part of the asset pipeline that will do this for you: #logo { background: url(<%= asset_data_uri 'logo.png' %>) }