加密数据 SVG URL
Encrypted Data SVG URL
我在浏览卫报的网站 (http://www.theguardian.com/uk) 时注意到他们使用 SVG 文件类型来提供他们的图像。奇怪的是 URL 路径是用一长串随机字符加密的。
我想知道是否有人知道他们是怎么做到的?代码或其他方式,以及他们以这种方式提供内容所获得的优势。
他们如何导入字体的示例:
他们 URL 的另一个例子是:
content:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMjAiIGhlaWdodD0iNjAiPjxwYXRoIGZpbGw9IiMwNTU2OEIiIGQ9Ik0yODQgNDVoMTZ2LTNsLTMtMS41di0yMGMxLjItLjkgMi44LTEuMSA0LjMtMS4xIDIuOCAwIDMuNy45IDMuNyA0LjF2MTdsLTMgMS41djNoMTZ2LTNsLTMtMS41di0xOWMwLTUuNy0yLjEtOC4zLTcuMS04LjMtNC4xIDAtOC4xIDEuNS0xMC44IDRWMTNoLTFsLTEyLjQgMi4ydjIuN2wzLjMgMS42djIxbC0zIDEuNXYzek0yNDUuMy40Yy0zIDAtNS40IDIuNC01LjQgNS41IDAgMyAyLjQgNS40IDUuNCA1LjQgMi45IDAgNS40LTIuNCA1LjQtNS40LS4xLTMuMS0yLjUtNS41LTUuNC01LjV6TTIzNyAxNS4xdjIuOGwzIDEuNnYyMC45bC0zIDEuNVY0NWgxNnYtMy4xbC0zLTEuNVYxMy4xaC0xbC0xMiAyek0yMjMgMzljLS43LjYtMS43IDEuMS0zLjIgMS4xLTQgMC01LjktMy4zLTUuOS0xMC45IDAtOC43IDIuNC0xMS42IDUuNi0xMS42IDEuOCAwIDIuOC42IDMuNSAxLjR2MjB6bTAtMjQuNGMtMS4yLS45LTMuMy0xLjQtNS0xLjQtNy40IDAtMTQuNSA0LjQtMTQuNSAxNi44IDAgMTEuOSA3LjEgMTUuNyAxMS44IDE1LjcgMy44IDAgNi40LTEuNyA3LjYtMy40aC4zdjMuM2guOWwxMS45LTEuNHYtMi4zbC0z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DUuNiAwIDkuNy0yLjcgMTEuMi00Ljd2LTNjLTIuMS43LTMuOSAxLjItNy43IDEuMi01LjYgMC05LjMtMy4yLTkuMy05LjJoMTh6TTY5LjkgMTYuNmMyLjUgMCAzLjggMS44IDMuOCA5LjZsLTguNC43Yy4xLTcuOSAxLjgtMTAuMyA0LjYtMTAuM3pNMzcgNDV2LTNsLTMtMS41VjIxYzEuMi0uOSAzLjItMS43IDQuOC0xLjcgMi44IDAgNC4zIDEuNiA0LjIgNC4ydjE3TDQwIDQydjNoMTZ2LTNsLTMtMS41di0xOWMwLTUuNy0zLjMtOC4zLTcuNy04LjMtNC4xIDAtOC42IDEuMy0xMS4zIDMuOFYwaC0xTDIxIDJ2M2w0IDEuNXYzNEwyMiA0MnYzaDE1ek00IDM2LjRjMCA1LjcgMi44IDkuMyA4LjkgOS4zIDMuMSAwIDYuMi0uOCA4LjEtMi4zdi0zLjhjLS44LjMtMS45LjUtMi45LjUtMi45IDAtNC4xLTEuNi00LjEtNC42VjE5aDd2LTVoLTdWNi41TDQgOHY2bC00IDF2NGg0djE3LjR6Ii8+PC9zdmc+)
长字符串不是加密字符串,它是代表内容的base64编码字符串。使用 base64 字符串是一种表示二进制数据的方式,可用于内联内容而不是通过其他方式获取内容(例如,通过提供 URL 来下载资源)。
Data URI Scheme 就是一个很好的例子,它也可以用于 SVG。
我在浏览卫报的网站 (http://www.theguardian.com/uk) 时注意到他们使用 SVG 文件类型来提供他们的图像。奇怪的是 URL 路径是用一长串随机字符加密的。
我想知道是否有人知道他们是怎么做到的?代码或其他方式,以及他们以这种方式提供内容所获得的优势。
他们如何导入字体的示例:
他们 URL 的另一个例子是:
content:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMjAiIGhlaWdodD0iNjAiPjxwYXRoIGZpbGw9IiMwNTU2OEIiIGQ9Ik0yODQgNDVoMTZ2LTNsLTMtMS41di0yMGMxLjItLjkg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YwaC0xTDIxIDJ2M2w0IDEuNXYzNEwyMiA0MnYzaDE1ek00IDM2LjRjMCA1LjcgMi44IDkuMyA4LjkgOS4zIDMuMSAwIDYuMi0uOCA4LjEtMi4zdi0zLjhjLS44LjMtMS45LjUtMi45LjUtMi45IDAtNC4xLTEuNi00LjEtNC42VjE5aDd2LTVoLTdWNi41TDQgOHY2bC00IDF2NGg0djE3LjR6Ii8+PC9zdmc+)
长字符串不是加密字符串,它是代表内容的base64编码字符串。使用 base64 字符串是一种表示二进制数据的方式,可用于内联内容而不是通过其他方式获取内容(例如,通过提供 URL 来下载资源)。
Data URI Scheme 就是一个很好的例子,它也可以用于 SVG。