The iv is prefixed to the encrypted data
aesCBC128Encrypt will create a random IV and prefixed to the encrypted code.
aesCBC128Decrypt will use the prefixed IV during decryption.
Inputs are the data and key are Data objects. If an encoded form such as Base64 if required convert to and/or from in ...
PHP has no support for running code concurrently unless you install extensions such as pthread. This can be sometimes bypassed by using proc_open() and stream_set_blocking() and reading their output asynchronously.
If we split code into smaller chunks we can run it as multiple suprocesses. Then usi...
This Example assumes you setup as explained in Example: Setting Up Environment for aurelia-cli Explained of this document.
Creating a new project
In main host os, open terminal (Mac OS in my case)
$cd /path/to/project/vagrant
$vagrant up (Launches VM GUI)
Log into VM via UI
U...
Use the below command to check the replica set status.
Command : rs.status()
Connect any one of replica member and fire this command it will give the full state of the replica set
Example :
{
"set" : "ReplicaName",
"date" : ISODate("2016-09-26T07:3...
Row-level security enables you to define some predicates that will control who could update rows in the table.
First you need to define some table-value function that represents predicate that wll control access policy.
CREATE FUNCTION
dbo.pUserCanAccessProduct(@CompanyID int)
RETURNS TABLE
WIT...
The point about temporary tables is that they're limited to the scope of the connection. Dapper will automatically open and close a connection if it's not already opened. That means that any temp table will be lost directly after creating it, if the connection passed to Dapper has not been opened.
...
Every good IDE provides a GUI for interactively debugging Ruby (and thus Rails) applications where you can add breakpoints, watches, auto pausing on exception and allows you to follow the code execution even step by step, line by line.
For example, take a look at one of the best Ruby IDE's, RubyMin...
Password Based Key Derivation can be used both for deriving an encryption key from password text and saving a password for authentication purposes.
There are several hash algorithms that can be used including SHA1, SHA256, SHA512 which are provided by this example code.
The rounds parameter is use...
See Swift 3 example for usage information and notes
func pbkdf2SHA1(password: String, salt: [UInt8], keyCount: Int, rounds: Int) -> [UInt8]? {
return pbkdf2(CCPBKDFAlgorithm(kCCPRFHmacAlgSHA1), password:password, salt:salt, keyCount:keyCount, rounds:UInt32(rounds))
}
func pbkdf2SHA256(p...
In order to compile the driver, it is necessary to have the Linux Kernel source tree.
Assuming the sources are at /lib/modules/<kernel-version>, the following Makefile will compile the file driver.c into the driver.ko Kernel Object
obj-m := driver.o
KDIR := /lib/modules/$(shell uname -r)/bu...
Func<int, int> add1 = i => i + 1;
Func<int, int, int> add = (i, j) => i + j;
// Behaviourally equivalent to:
int Add1(int i)
{
return i + 1;
}
int Add(int i, int j)
{
return i + j;
}
...
Console.WriteLine(add1(42)); //43
Console.WriteLine(Add1(42));...
See remarks for discussion of closures. Suppose we have an interface:
public interface IMachine<TState, TInput>
{
TState State { get; }
public void Input(TInput input);
}
and then the following is executed:
IMachine<int, int> machine = ...;
Func<int, int> machineC...
Introduction
Texas Instruments' (TI) CC26XX series SoCs are readily available wireless MCUs targeting Bluetooth Low Energy (BLE) applications. Along with the MCUs, TI offers a full-fledged software stack that provides necessary API and sample codes to help quickly get developers started with the to...
See Swift 3 example for usage information and notes
func pbkdf2SHA1Calibrate(password:String, salt:[UInt8], msec:Int) -> UInt32 {
let actualRoundCount: UInt32 = CCCalibratePBKDF(
CCPBKDFAlgorithm(kCCPBKDF2),
password.utf8.count,
salt.count,
CCPseudoRandom...
Determine the number of PRF rounds to use for a specific delay on the current platform.
Several parameters are defaulted to representative values that should not materially affect the round count.
password Sample password.
salt Sample salt.
msec Targeted duration we want to achieve f...