Libraries anvil

namespace anvil

Namespaces

namespace arrays
Efficient implementation of arrays containing numeric and string values.

namespace char
Set of functions for checking whether given string falls into certain character class. These checks are locale-specific.

namespace comm
Frequently used network communications utilities, such as reading and writing files using ftp and http, sending e-mail, etc. Supported data types: The url strings in this module can be any of the following (for example)
Author Jaripekka Salminen

namespace crypto
Digest and MAC codes, encryption.

Digest and MAC codes

Anvil crypto library can create message hash codes or checksums from any data. Such codes are useful, for example, in payment applications, where the checksum verifies that data has not been changed. Also the hash codes taken from file contents are useful for checking if the file content is changed or not.

Example. Compute the MD5 digest and hmac and print them out as hex.

 key = "Jefe";
 data = "what do ya want for nothing?";
 digest = crypto.MD5().update(data).final().toHex();
 hmac = crypto.MD5(key).update(data).final().toHex();
 print "The digest is "+digest;
 print "The hmac is "+hmac;
 
This will produce:
 The digest is d03cb659cbf9192dcd066272249f8412
 The hmac is 750c783e6ab0b503eaa86e310a5db738
 

Encryption

Anvil crypto library can also encrypt and decrypt data using DES, TripleDes and Blowfish algorithms.

Example. Encrypt and decrypt a data string using DES.

 key = "Jefe1234";
 data1 = "what do ya want ";
 data2 = "for nothing?";
 cipher = crypto.encrypt(crypto.DES, key);
 crypted = cipher.update(data1);
 crypted = crypted.concat(cipher.update(data2));
 crypted = crypted.concat(cipher.final());
 recovered = crypto.decrypt(crypto.DES, key).final(crypted);
 
Author Jaripekka Salminen

namespace io
Provides for system input and output through data streams, serialization and the file system.

namespace lang
Set of elementary functions and classes. Entities at anvil.lang are accessible directly without a need to import or use anvil.lang prefix.

namespace math
Standard set of mathematical operations.

namespace naming
Provides the functions and classes and for accessing naming services.

namespace net
Provides access to network services.

namespace runtime
Provides access to runtime related operations, such as output redirection and type inspection.

namespace sql
Provides access to relation databases through the JDBC interface.

namespace system
Provides access to system related operations, such as server's resources and configuration.

namespace time
Timestamps and calendar.

namespace xml
Operations for parsing and inspecting XML documents.