Hash Function


If you wish to leave comments or ask questions, please log on or sign up.

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Interested
Rating: 12
Joined: Nov 10, 2011
Company: 1A Software e.U

Hello!

I could not find methodical documentation about HashFunction.SHA256. Could somebody write a few examples?

Thanks!

Lioudmila

 
#2
People who like this:1Yes/0No
Active user
Rating: 6
Joined: Nov 19, 2012
Company: BizzSimple.com

Code
HashObject = New DataHashing(HashFunction.SHA256);
//First option - get hash fr om the file
HashObject.AppendFile("<path to the file>");
//Second option - get hash from the string
HashObject.Append("My string");
BinaryHash = HashObject.HashSum;

Wh ere BinaryHash is your hash in binary form.
One of the ways to get it as string is to convert it into the Base64 form:
Code
StringRepresentation = Base64String(BinaryHash);

Edited: Alexey Bochkov - Feb 20, 2017 06:47 PM
 
#3
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Mar 10, 2017
Company: Rufinor

Alexey, hello! Please advise how can I run DataHashing class in 1c. There is no such class.

Thank you!
Alex

 
#4
People who like this:0Yes/0No
Administrator
Rating: 105
Joined: Jul 20, 2011
Company: 1C Company

Hello, Alex, you should execute the script that Alexey provided on server.

1C Company support team
 
#5
People who like this:0Yes/0No
Interested
Rating: 12
Joined: Nov 10, 2011
Company: 1A Software e.U

Hello!

Thank you for the answers!

It ist very useful, but I have more information about this task. The real challenge is reading and writing of signatures using a smart card. This smart card is a chip and is placed in an USB-Stick. The chip looks like in bank cards or sim-cards.

In java there is some library

Code
sun.security.pkcs11.SunPKCS11


I really have no idea how it should work. Additional information that I have is java-technology
Package javax.smartcardio
Java™ Smart Card I/O API

In C++ there are Standard Windows library (winscard).

I can not say more about this subject. Maybe somebody has experience? Or at least if it generally works using 1C?

Thanks a lot in advance!

 
Subscribe