在我的C++应用程序中,我嵌入了(通过COM)Web浏览器(Internet Explorer)控件(CLSID_WebBrowser).
我可以使用IHTMLDocument2 :: write()方法在该控件中显示我自己的html,但如果html有<img src="foo.png">
元素,则不会显示.
我假设有一种方法让我以某种方式为web控件提供foo.png的数据,但我找不到合适的地方来挂钩这个功能?
我需要完全控制提供foo.png的内容,所以解决方法如使用res://协议或保存到磁盘并使用file://协议都不够好.我只是想以某种方式插入我的代码,以便当嵌入式CLSID_WebBrowser控件<img src="foo.png">
在IHTMLDocument2 :: write()给出的html数据中看到它时,它会要求我提供这些数据.
我试图在Go中获取文件的md5哈希值,如下所示:
running_hash := md5.New(); // type hash.Hash
running_hash.Write(data); // data is []byte
sum := running_hash.Sum(); // []uint8 according to the compiler
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试获取哈希的'sum'字符串(http://golang.org/pkg/hash/)时,通过
sumstring := string(sum); // returns '???]???N??' or similar
Run Code Online (Sandbox Code Playgroud)
什么时候哈希应该是d3be9e835dec95bfbef34ebe1fbf03da
.当我尝试逐字节转换时,我得到了同样的废话,只有不同的字符.
我的意思是如何获取哈希的字符串?