<commit_before>describe 'crypto', ->

  priv_pem = "-----<KEY>"

  pub_pem = "-----<KEY>"

  it 'should sign and verify signature', (done) ->

    data = 'foo'

    Crypt.make priv_pem, (err, signer) ->
        signer.sign data, (err, signed) ->
            Crypt.make pub_pem, (err, verifier) ->
                verifier.verify signed, (err, verified) ->
                    expect(verified).toEqual(data)
                    done()

  it 'should encrypt and decrypt', (done) ->

    data = 'foo'

    Crypt.make pub_pem, (err, encrypter) ->
        encrypter.encrypt data, (err, encrypted) ->
            Crypt.make priv_pem, (err, decrypter) ->
                decrypter.decrypt encrypted, (err, decrypted) ->
                    expect(decrypted).toEqual(data)
                    done()<commit_msg>use same keys in js test<commit_after>describe 'crypto', ->

  PRIVATE_KEY =
    """
    <KEY>
    -----END RSA PRIVATE KEY-----
    """

  PUBLIC_KEY =
    """
    -----BEGIN PUBLIC KEY-----
    <KEY>
    -----END PUBLIC KEY-----
    """

  it 'should sign and verify signature', (done) ->

    data = 'foo'

    Crypt.make PRIVATE_KEY, (err, signer) ->
        signer.sign data, (err, signed) ->
            Crypt.make PUBLIC_KEY, (err, verifier) ->
                verifier.verify signed, (err, verified) ->
                    expect(verified).toEqual(data)
                    done()

  it 'should encrypt and decrypt', (done) ->

    data = 'foo'

    Crypt.make PUBLIC_KEY, (err, encrypter) ->
        encrypter.encrypt data, (err, encrypted) ->
            Crypt.make PRIVATE_KEY, (err, decrypter) ->
                decrypter.decrypt encrypted, (err, decrypted) ->
                    expect(decrypted).toEqual(data)
                    done()
{'fraction_non_alphanumeric': 0.15042735042735042, 'fraction_numerical': 0.0, 'mean_word_length': 1.6932515337423313, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6793801', 'n_tokens_mistral': 586, 'n_tokens_neox': 530, 'n_words': 132}