Updating a field programmatically, hook_node_update Currently trying to update a field every time a node is created or updated. However the value is not being populated within the node, do I have access to the node object with this particular hook? What could I be missing?

  function vbtoken_node_update($node) {


      entity_get_controller('node')-&gt;resetCache(array($node-&gt;nid));


      $types = node_type_get_types(); //What are the current Node Content Types?
      $yes = ($types['volunteer_project']-&gt;type);

      if($node-&gt;type === $yes){


        $hash = md5($node-&gt;title . $node-&gt;nid . $node-&gt;nid);
        $hashed = substr($hash, 0, 6);
        $node = node_load($node-&gt;nid);
        $node-&gt;tcode[$node-&gt;language][0]['value'] = $hashed;
        node_save($node);

        watchdog('vbtoken', 'Added a new Token code to %nid', array('%nid' =&gt; $node-&gt;nid));

        }
        else 
        {
          dpm('not working dude');
        }

    }
Entity metadata wrappers

The entity API provides some wrapper classes you may use to easily deal with entities and to leverage the entity property information modules provided. With the help of the wrappers you can access the property information, loop over known properties, or just get/set the described data values, etc.

These are some simple usage examples as found in the README:

For making use of this information (metadata) the module provides some
wrapper classes which ease getting and setting values. The wrapper supports
chained usage for retrieving wrappers of entity properties, e.g. to get a
node author's mail address one could use:

$wrapper = entity_metadata_wrapper('node', $node);
$wrapper-&gt;author-&gt;mail-&gt;value();


To update the user's mail address one could use

$wrapper-&gt;author-&gt;mail-&gt;set('sepp@example.com');


or

$wrapper-&gt;author-&gt;mail = 'sepp@example.com';


The wrappers always return the data as described in the property
information, which may be retrieved directly via entity_get_property_info()
or from the wrapper:

$mail_info = $wrapper-&gt;author-&gt;mail-&gt;info();


In order to force getting a textual value sanitized for output one can use,
    e.g.

$wrapper-&gt;title-&gt;value(array('sanitize' =&gt; TRUE));


to get the sanitized node title. When a property is already returned
sanitized by default, like the node body, one possibly wants to get the
not-sanitized data as it would appear in a browser for other use-cases.
To do so one can enable the 'decode' option, which ensures for any sanitized
data the tags are stripped and HTML entities are decoded before the property
is returned:

$wrapper-&gt;body-&gt;value-&gt;value(array('decode' =&gt; TRUE));


That way one always gets the data as shown to the user. However if you
really want to get the raw, unprocessed value, even for sanitized textual
data, you can do so via:

$wrapper-&gt;body-&gt;value-&gt;raw();


More examples:

$wrapper-&gt;body-&gt;set(array('value' =&gt; "content"));
$wrapper-&gt;field_text[0] = 'the text';
$wrapper-&gt;field_text[0]-&gt;set(array('value' =&gt; "content"));
$wrapper-&gt;field_text2-&gt;summary = 'the summary';
$wrapper-&gt;field_text2-&gt;value = 'the text';

$wrapper-&gt;save();
$wrapper-&gt;delete();


More docs: http://drupal.org/node/1021556