Comments (7)
You can use
function DataToHex(InData: Pointer; ByteLength: Integer; UseUpperCase: Boolean = True): string;
in CnNative.pas to directly convert the memory content of Float number to a hex string.
given
var
A: Single;
begin
Caption := DataToHex(@A, SizeOf(A));
end;
from cnvcl.
thanksthanks
from cnvcl.
I only found the function: #1#2#3#4 <---> '1234'.
But I want a function:12.5 <---> '41 48 00 00'
Thanks
from cnvcl.
Could you use my code piece and check the result?
var
A: Single;
begin
A := 12.5;
Result := DataToHex(@A, SizeOf(A));
end;
In above:
function DataToHex(InData: Pointer; ByteLength: Integer; UseUpperCase: Boolean = True): string;
is in cnvcl\Source\Crypto\CnNative.pas
from cnvcl.
Thank you for your guidance。
I misunderstand at first. Now I also want to know which function could convert # $41 48 00 00 to 12.5 , hex-->single。
Happy Chinese new year!
from cnvcl.
There's also a function HexToData in CnNative.pas
Note:
- Space Chars in String should be removed before calling this function.
- Notice the BigEndian/Little Endian byte order after conversion.
from cnvcl.
These compoments is very good, but there are a few documents。Thanks
from cnvcl.
Related Issues (20)
- Transparent property for TCnAAScrollText HOT 4
- CnRSA签名后无法验签 HOT 1
- CnKDF.pas中CnPBKDF2函数使用cpdfSha256Hmac参数时输入迭代次数无效,只会迭代一次。 HOT 2
- 64-bit not supported? HOT 1
- 请教:SM4使用java中的byte数组加密结果不一致 HOT 13
- Cnvcl20220601无法编译,CnRSA等多个单元出错 HOT 1
- CnVcl does not link in C++ Builder 6 Professional (missing msxml.dcu)
- Delphi 11.1下Cnvcl20220701无法编译,ECN_OK缺少 HOT 4
- Delphi 11.1下dclCnpack_D110A Never-build package 'vcl' must be recompiled HOT 1
- Lazarus 无法安装 HOT 5
- CnRandom单元的StopRandom在 Windows x64 程序退出时会触发异常 HOT 5
- TCnAAFadeText random EOutOfResources Exception HOT 3
- F2 shortcut not working. Save meu item does. HOT 2
- sm2等国密算法不能在lazarus使用 HOT 22
- 建议将源码文件的编码方式改为UTF-8 HOT 1
- 使用 FPC 编译目标为 Linux-ARM64 的程序发现 CnDES 单元一个非常奇怪的问题 HOT 2
- CnWaterEffect.pas HOT 3
- D10.4下使用加解密组件好像有问题…… HOT 3
- CnAES.pas中ExpandAESKeyForDecryption256Expanded实现部分多了 overload 定义导致在 fpc 中编译失败 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cnvcl.