---
# System prepended metadata

title: Technical Task for RUST Engineer

---

# Technical Task for RUST Engineer


User enters ASCII string in the command line. 
You have to create an application that can find 32 bytes hash number which will end-up with the bytes representation of the entered string


```python
import binascii
import random
import hashlib


def solve(input):
    str_val = input.encode('ascii')
    hex_val = binascii.hexlify(str_val).decode('ascii')
    hex_val_len = len(hex_val)

    m = hashlib.sha256()
    while(True):
        r = random.randbytes(256)
        m.update(r)
        H = m.hexdigest()
        if hex_val == H[-1*hex_val_len:]:
            return H


if __name__ == '__main__':
    result = solve('near')
    print(result)

```

Example (private):

```bash=
$ main.py near
2421c100d3618f86ebe323f4ab3bb30397ec7868a3ec2c970229b9776e656172
```

Where '6e656172' is bytes representation of ASCII string 'near'